<!--
-File         $Id$
-License      GNU FDL (http://www.gnu.org/copyleft/fdl.html)
-Copyright    2002, turing
-Author       alex black, enigma@turingstudio.com
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Phing Guide - Core Filters</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="Stylesheet" rev="Stylesheet"
	href="../../css/Documentation.css" type="text/css" media="All"
	charset="iso-8859-1" />
</head>
<body>

	<h1>
		<a name="CoreFilters"></a>Appendix D-2: Core Filters
	</h1>

	<p>
		Filters are a subset of Phing <em>data types</em> which provide for
		the transformation of file contents during the operation of another
		task. For example, a filter might replace tokens in a file as part of
		a copy task.
	</p>

	<p>
		Filters have to be defined within a <em>&lt;filterchain&gt;</em>
		context to work. Example:
	</p>

	<pre>
&lt;filterchain&gt;
  &lt;expandproperties /&gt;
&lt;/filterchain&gt;
</pre>
	<p>
		There are two ways to use a filter: System filters (the ones shipped
		with Phing) can be used with their own tag name, such as <em>&lt;xsltfilter</em>&gt;,
		&lt;<em>expandpropertyfilter</em>&gt; or <em>&lt;tabtospaces</em>&gt;.
		User-defined filters can use the way is to use the <em>&lt;filterreader&gt;</em>
		tag.
	</p>

	<h2>
		<a name="PhingFilterReader"></a>PhingFilterReader
	</h2>
	<p>The PhingFilterReader is used when you want to use filters that
		are not directly available through their own tag. Example:</p>
	<pre>
&lt;filterchain&gt;
  &lt;filterreader classname=&quot;phing.filter.ReplaceTokens&quot;&gt;
    &lt;-- other way to set attributes --&gt;
    &lt;param name=&quot;begintoken&quot; value=&quot;@@&quot; /&gt;
    &lt;param name=&quot;endtoken&quot; value=&quot;@@&quot; /&gt;

    &lt;-- other way to set nested tags --&gt;
    &lt;param type=&quot;token&quot; key=&quot;bar&quot; value=&quot;foo&quot; /&gt;
  &lt;/filterreader&gt;
&lt;/filterchain&gt;
</pre>
	<p>
		In the <em>filterreader</em> tag you have to specify the path the
		class is in. The <em>FilterReader</em> will then load this class and
		pass the parameters to the loaded filter. There are two types of
		parameters: First, you can pass &quot;normal&quot; parameters to the
		loaded filter. That means, you can pass parameters as if they were
		attributes. If you want to do this, you only specify the <em>name</em>
		and <em>value</em> attributes in the <em>param</em> tag. You can also
		pass nested elements to the filter. Then, you have to specify the <em>type</em>
		attribute. This attribute specifies the name of the nested tag.
	</p>
	<p>The result of the example above is identical with the following
		code:</p>
	<pre>
&lt;filterchain&gt;
  &lt;replacetokens begintoken=&quot;@@&quot; endtoken=&quot;@@&quot;&gt;
    &lt;token key=&quot;bar&quot; value=&quot;foo&quot; /&gt;
  &lt;/replacetokens&gt;
&lt;/filterchain&gt;</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for <em>&lt;filterreader&gt;</em>
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>classname</td>
				<td>String</td>
				<td>Name of class to use (in dot-path notation).</td>
				<td>n/a</td>
				<td>Yes</td>
			</tr>
			<tr>
				<td>classpath</td>
				<td>String</td>
				<td>The classpath to use when including classes. This is added
					to PHP's include_path.</td>
				<td>n/a</td>
				<td>No</td>
			</tr>
			<tr>
				<td>classpathref</td>
				<td>String</td>
				<td>Reference to classpath to use when including classes. This
					is added to PHP's include_path.</td>
				<td>n/a</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>
	<h3>Nested Tags</h3>
	<p>
		The <em>PhingFilterReader</em> supports nested &lt;classpath&gt;.
	</p>
	<h3>Advanced</h3>
	<p>In order to support the &lt;filterreader ... /&gt; sytax, your
		class must extend the BaseParamFilterReader class. Most of the filters
		that are bundled with Phing can be invoked using this syntax. The
		noteable exception (at time of writing) is the ReplaceRegexp filter,
		which expects find/replace parameters that do not fit the name/value
		mold. For this reason, you must always use the shorthand
		&lt;replaceregexp .../&gt; to invoke this filter.</p>

	<h2>
		<a name="ExpandProperties"></a>ExpandProperties
	</h2>
	<p>The ExpandProperties simply replaces property names with their
		property values. For example, if you have the following in your build
		file:</p>
	<pre>
&lt;property name=&quot;description.txt&quot; value=&quot;This is a text file&quot; /&gt;

&lt;copy todir=&quot;/tmp&quot;&gt;
  &lt;filterchain&gt;
    &lt;expandproperties /&gt;
  &lt;/filterchain&gt;

  &lt;fileset dir=&quot;.&quot;&gt;
    &lt;include name=&quot;**&quot; /&gt;
  &lt;/fileset&gt;
&lt;/copy&gt;
</pre>
	<p>
		And the string <em>${description.txt}</em> it will be replaced by <em>This
			is a text file</em>.
	</p>
    <h3>Attributes</h3>
    <table>
        <caption>
            Attributes for <em>&lt;expandproperties&gt;</em>
        </caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Type</th>
                <th>Description</th>
                <th>Default</th>
                <th>Required</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>level</td>
                <td>String</td>
                <td>Control the level at which this message is reported. One of
                    <em>error</em>, <em>warning</em>, <em>info</em>, <em>verbose</em>,
                    <em>debug</em>.</td>
                <td><em>info</em></td>
                <td>No</td>
            </tr>
        </tbody>
    </table>
    
	<h2>
		<a name="HeadFilter"></a>HeadFilter
	</h2>
	<p>
		This filter reads the first <em>n</em> lines of a file; the others are
		not further passed through the filter chain. Usage example:
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;headfilter lines=&quot;20&quot; /&gt;
&lt;/filterchain&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;headfilter&gt; </em>tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>lines</td>
				<td>Integer</td>
				<td>Number of lines to read.</td>
				<td>10</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>

	<h2>
		<a name="IconvFilter"></a>IconvFilter
	</h2>

	<p>
		The IconvFilter encodes file from
		<code>in</code>
		encoding to
		<code>out</code>
		encoding. Usage example:
	</p>

	<pre>
&lt;filterchain&gt;
    &lt;iconvfilter inputencoding="UTF-8" outputencoding="CP1251" /&gt;
&lt;/filterchain&gt;
</pre>

	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;iconvfilter&gt; </em>tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>inputencoding</td>
				<td>string</td>
				<td>Input encoding.</td>
				<td>n/a</td>
				<td>Yes</td>
			</tr>
			<tr>
				<td>outputencoding</td>
				<td>string</td>
				<td>Output encoding.</td>
				<td>n/a</td>
				<td>Yes</td>
			</tr>
		</tbody>
	</table>

	<h2>
		<a name="LineContains"></a>Line Contains
	</h2>
	<p>
		This filter is only &quot;permeable&quot; for lines that contain the
		expression given as parameter. For example, the following filterchain
		would only let all the lines pass that contain <em>class</em>:
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;linecontains&gt;
    &lt;contains value=&quot;class&quot; /&gt;
  &lt;/linecontains&gt;
&lt;/filterchain&gt;
</pre>

	<h3>Nested Tags</h3>

	<p>
		The <em>linecontains</em> tag must contain one or more <em>contains</em>
		tags. Latter must have a <em>value</em> attribute that has to be set
		to the string the line has to contain to be let through.
	</p>

	<h2>
		<a name="LineContainsRegexp"></a>LineContainsRegexp
	</h2>
	<p>
		This filter is similar to <a href="#LineContains">LineContains</a> but
		you can specify regular expressions instead of simple strings.
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;linecontainsregexp&gt;
    &lt;regexp pattern=&quot;foo(.*)bar&quot; /&gt;
  &lt;/linecontainsregexp&gt;
&lt;/filterchain&gt;
</pre>

	<h3>Nested Tags</h3>

	<p>
		The <em>LineContains</em> filter has to contain at least one <em>regexp</em>
		tag. This must have a <em>pattern</em> attribute that is set to a
		regular expression.
	</p>

	<h2>
		<a name="PrefixLines"></a>PrefixLines
	</h2>
	<p>
		This filter adds a prefix to every line. The following example will
		add the string <em>foo: </em> in front of every line.
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;prefixlines prefix=&quot;foo: &quot; /&gt;
&lt;/filterchain&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;prefixlines&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>prefix</td>
				<td>string</td>
				<td>Strint to prepend to every line.</td>
				<td>n/a</td>
				<td>Yes</td>
			</tr>
		</tbody>
	</table>

	<h2>
		<a name="ReplaceTokens"></a>ReplaceTokens
	</h2>
	<p>
		The <em>ReplaceTokens</em> filter will replace certain tokens. Tokens
		are strings enclosed in special characters. If you want to replace <em>##BCHOME##</em>
		by the path to the directory set in the environment variable <em>BCHOME</em>,
		you could do the following:
	</p>
	<pre>
&lt;property environment=&quot;env&quot; /&gt;

&lt;filterchain&gt;
  &lt;replacetokens begintoken=&quot;##&quot; endtoken=&quot;##&quot;&gt;
    &lt;token key=&quot;BCHOME&quot; value=&quot;${env.BCHOME}&quot; /&gt;
  &lt;/replacetokens&gt;
&lt;/filterchain&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;replacetokens&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>begintoken</td>
				<td>string</td>
				<td>The string that marks the beginning of a token.</td>
				<td>@</td>
				<td>No</td>
			</tr>
			<tr>
				<td>endtoken</td>
				<td>string</td>
				<td>The string that marks the end of a token.</td>
				<td>@</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>
	<h3>Nested Tags</h3>
	<p>
		The <em>ReplaceTokens</em> filter must contain one or more <em>token</em>
		tags. These must have a <em>key</em> and a <em>value</em> attribute.
	</p>

	<h2>
		<a name="ReplaceTokensWithFile"></a>ReplaceTokensWithFile
	</h2>
	<p>
		The <em>ReplaceTokensWithFile</em> filter will replace certain tokens
		with the contents of a file. The name of the file to use as
		replacement is derived from the token name itself. Tokens are strings
		enclosed in special characters which are user selectable.
	</p>
	<p>This filter could for example be used to insert code examples in
		documentation where the example code are real executable files kept
		outside the documentation.</p>
	<p>
		If you for example want to replace <em>#!example1##</em> with the
		content of the file "
		<code>example1.php</code>
		" you could do the following
	</p>
	<pre>
      &lt;filterchain&gt;
      &lt;replacetokenswithfile begintoken=&quot;#!&quot; endtoken=&quot;##&quot;
          dir="exampledir/" postfix=".php" /&gt;
      &lt;/filterchain&gt;
    </pre>
	<p>
		The filer above will replace all tokens within the begin and end token
		specified with the contents of the file whose base name is that of the
		token with the added postfix &quot;.php&quot;. Only the directory
		specified in the <em>dir</em> attribute is searched. If the file is
		not found the token is left untouched and an error message is given.
		It is important to note that <b>all</b> found tokens will be replaced
		with the corresponding file. So in the example below even <em>#!example2##</em>
		will be replaced with the content of the file "
		<code>example2.php</code>
		"
	</p>

	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;replacetokenswithfile&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>begintoken</td>
				<td>string</td>
				<td>The string that marks the beginning of a token.</td>
				<td>#@#</td>
				<td>No</td>
			</tr>
			<tr>
				<td>endtoken</td>
				<td>string</td>
				<td>The string that marks the end of a token.</td>
				<td>#@#</td>
				<td>No</td>
			</tr>
			<tr>
				<td>prefix</td>
				<td>string</td>
				<td>A string that will be added in front of the token to
					construct the filename that will be used as source when replacing
					the token.</td>
				<td>''</td>
				<td>No</td>
			</tr>
			<tr>
				<td>postfix</td>
				<td>string</td>
				<td>A string that will be added to the end of the token to
					construct the filename that will be used as source when replacing
					the token.</td>
				<td>''</td>
				<td>No</td>
			</tr>
			<tr>
				<td>dir</td>
				<td>string</td>
				<td>The directory where to look for the files to use as
					replacements for the tokens</td>
				<td>'./'</td>
				<td>No</td>
			</tr>
			<tr>
				<td>translatehtml</td>
				<td>boolean</td>
				<td>If true all html special characters (e.g. "&gt;") in the file
					to there corresponding html entities (e.g. "&amp;gt;") before the
					file is inserted.</td>
				<td>true</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>

	<h3>Nested Tags</h3>
	<p>None.</p>

	<h2>
		<a name="ReplaceRegexp"></a>ReplaceRegexp
	</h2>
	<p>
		The <em>ReplaceRegexp</em> filter will perform a regexp find/replace
		on the input stream. For example, if you want to replace ANT with
		Phing (ignoring case) and you want to replace references to *.java
		with *.php:
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;replaceregexp&gt;
	&lt;regexp pattern=&quot;ANT&quot; replace=&quot;Phing&quot; ignoreCase=&quot;true&quot;/&gt;
	&lt;regexp pattern=&quot;(\w+)\.java&quot; replace=&quot;\1.php&quot;/&gt;
  &lt;/replaceregexp&gt;
&lt;/filterchain&gt;
</pre>

	<h3>Nested Tags</h3>
	<p>
		The <em>ReplaceTokens</em> filter must contain one or more <em>regexp</em>
		tags. These must have <em>pattern</em> and <em>replace</em>
		attributes. The full list of supported attributes is as following:
	</p>
	<table>
		<caption>
			Attributes for the <em>&lt;regexp&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>pattern</td>
				<td>string</td>
				<td>Regular expression used as needle. Phing relies on <a
					href="http://php.net/pcre">Perl-compatible</a> regular expressions.
				</td>
				<td>n/a</td>
				<td>Yes</td>
			</tr>
			<tr>
				<td>replace</td>
				<td>string</td>
				<td>Replacement string.</td>
				<td>n/a</td>
				<td>Yes</td>
			</tr>
			<tr>
				<td>ignoreCase</td>
				<td>boolean</td>
				<td>Whether search is case-insensitive.</td>
				<td>false</td>
				<td>No</td>
			</tr>
			<tr>
				<td>multiline</td>
				<td>boolean</td>
				<td>Whether regular expression is applied in multi-line mode.</td>
				<td>false</td>
				<td>No</td>
			</tr>
			<tr>
				<td>modifiers</td>
				<td>string</td>
				<td>Raw regular expression <a
					href="http://php.net/manual/en/reference.pcre.pattern.modifiers.php">modifiers</a>.
					You can pass several modifiers as single string, and use raw
					modifiers with <em>ignoreCase</em> and <em>multiline</em>
					attributes. In case of conflict, value specified by dedicated
					attribute takes precedence.</td>
				<td>''</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>

	<p>
		The previous example (using <em>modifiers</em> attribute this time):
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;replaceregexp&gt;
	&lt;regexp pattern=&quot;ANT&quot; replace=&quot;Phing&quot; modifiers=&quot;i&quot;/&gt;
	&lt;regexp pattern=&quot;(\w+)\.java&quot; replace=&quot;\1.php&quot;/&gt;
  &lt;/replaceregexp&gt;
&lt;/filterchain&gt;
</pre>



	<h2>
		<a name="StripLineBreaks"></a>StripLineBreaks
	</h2>
	<p>
		The <em>StripLineBreaks</em> filter removes all linebreaks from the
		stream passed through the filter chain.
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;striplinebreaks /&gt;
&lt;/filterchain&gt;
</pre>

	<h2>
		<a name="StripLineComments"></a>StripLineComments
	</h2>
	<p>
		The <em>StripLineComments</em> filter removes all line comments from
		the stream passed through the filter chain:
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;striplinecomments&gt;
    &lt;comment value=&quot;#&quot; /&gt;
    &lt;comment value=&quot;--&quot; /&gt;
    &lt;comment value=&quot;//&quot; /&gt;
  &lt;/striplinecomments&gt;
&lt;/filterchain&gt;
</pre>

	<h3>Nested Tags</h3>
	<p>
		The <em>striplinecomments</em> tag must contain one or more <em>comment</em>
		tags. These must have a <em>value</em> attribute that specifies the
		character(s) that start a line comment.
	</p>

	<h2>
		<a name="StripPhpComments"></a>StripPhpComments
	</h2>
	<p>
		The <em>StripPhpComments</em> filter removes all PHP comments from the
		stream passed through the filter.
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;stripphpcomments /&gt;
&lt;/filterchain&gt;
</pre>

	<h2>
		<a name="StripWhitespace"></a>StripWhitespace
	</h2>
	<p>
		The <em>StripWhitespace</em> filter removes all PHP comments and
		whitespace from the stream passed through the filter. Internally, this
		filter uses the php_strip_whitespace() function.
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;stripwhitespace /&gt;
&lt;/filterchain&gt;
</pre>

	<h2>
		<a name="TabToSpaces"></a>TabToSpaces
	</h2>
	<p>The TabToSpaces filter replaces all tab characters with a given
		count of space characters.</p>
	<pre>
&lt;filterchain&gt;
  &lt;tabtospaces tablength=&quot;8&quot; /&gt;
&lt;/filterchain&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;tabtospaces&gt;</em> filter
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>tablength</td>
				<td>Integer</td>
				<td>The number of space characters that a tab is to represent.
				</td>
				<td>8</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>

	<h2>
		<a name="TailFilter"></a>TailFilter
	</h2>
	<p>
		Similar to <a href="#HeadFilter">HeadFilter</a>, this filter reads the
		last <em>n</em> lines of a file; the others are not further passed
		through the filter chain. Usage example:
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;tailfilter lines=&quot;20&quot; /&gt;
&lt;/filterchain&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;tailfilter&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>lines</td>
				<td>Integer</td>
				<td>Number of lines from the back to read.</td>
				<td>10</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>

	<h2>
		<a name="TidyFilter"></a>TidyFilter
	</h2>
	<p>
		The <em>TidyFilter</em> allows you to use the <a
			href="http://php.net/tidy">PHP tidy extension</a> to clean up and
		repair HTML documents. Usage example:
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;tidyfilter encoding=&quot;utf8&quot;&gt;
    &lt;config name=&quot;indent&quot; value=&quot;true&quot; /&gt;
    &lt;config name=&quot;output-xhtml&quot; value=&quot;true&quot; /&gt;
  &lt;/tidyfilter&gt;
&lt;/filterchain&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;tidyfilter&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>encoding</td>
				<td>String</td>
				<td>The expected input encoding of the file.</td>
				<td>utf8</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>
	<h3>Nested Tags</h3>
	<p>
		The <em>TidyFilter</em> supports nested &lt;config&gt; tags to
		configure how Tidy should manipulate the documents. For a complete
		list of configuration options see the offical <a
			href="http://tidy.sourceforge.net/docs/quickref.html">Quick
			Reference</a>.
	</p>

	<h2>
		<a name="XincludeFilter"></a>XincludeFilter
	</h2>
	<p>
		The <em>XincludeFilter</em> processes a stream for Xinclude tags, and
		processes the inclusions. This is useful for processing modular XML
		files. DocBook book files are one example of modular XML files. Usage
		example:
	</p>
	<pre>
&lt;!--
  Render a DocBook book file called manual.xml, which
  contains Xinclude tags to include individual book sections.
  --&gt;
&lt;copy todir=&quot;${manual.dest.dir}&quot;&gt;
  &lt;filterchain&gt;
    &lt;xincludefilter basedir=&quot;${manual.src.dir}&quot; /&gt;
    &lt;xsltfilter style=&quot;${manual.src.dir}/html.xsl&quot;&gt;
      &lt;param name=&quot;base.dir&quot; expression=&quot;${manual.dest.dir}/&quot; /&gt;
    &lt;/xsltfilter&gt;
  &lt;/filterchain&gt;
  &lt;fileset dir=&quot;${manual.src.dir}&quot;&gt;
    &lt;include name=&quot;manual.xml&quot; /&gt;
  &lt;/fileset&gt;
&lt;/copy&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;xincludefilter&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>basedir</td>
				<td>String</td>
				<td>The working directory from which to process the Xincludes.
					Relative pathnames in the include tags are based on this location.
				</td>
				<td>Project basedir</td>
				<td>No</td>
			</tr>
			<tr>
				<td>resolveexternals</td>
				<td>Boolean</td>
				<td>Whether to resolve entities. (see <a
					href="http://www.php.net/manual/en/class.domdocument.php#domdocument.props.resolveexternals"
					target="_blank">this link</a> for details)</td>
				<td>false</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>

	<h2>
		<a name="XsltFilter"></a>XsltFilter
	</h2>
	<p>
		The <em>XsltFilter</em> applies a XSL template to the stream. Though
		you can use this filter directly, you should use <a
			href="AppendixB-CoreTasks.html#XsltTask">XsltTask</a> which is
		shortcut to the following lines:
	</p>
	<pre>
&lt;filterchain&gt;
  &lt;xsltfilter style=&quot;somexslt.xsl&quot; /&gt;
&lt;/filterchain&gt;
</pre>
	<h3>Attributes</h3>
	<table>
		<caption>
			Attributes for the <em>&lt;xsltfilter&gt;</em> tag
		</caption>
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Description</th>
				<th>Default</th>
				<th>Required</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>style</td>
				<td>String</td>
				<td>The XSLT stylesheet to use for transformation.</td>
				<td>n/a</td>
				<td>Yes</td>
			</tr>
			<tr>
				<td>html</td>
				<td>Boolean</td>
				<td>Whether to parse the input as HTML (using libxml2
					DOMDocument::loadHTML()).</td>
				<td>false</td>
				<td>No</td>
			</tr>
			<tr>
				<td>resolvedocumentexternals</td>
				<td>Boolean</td>
				<td>Whether to resolve entities in the XML document. (see <a
					href="http://www.php.net/manual/en/class.domdocument.php#domdocument.props.resolveexternals"
					target="_blank">this link</a> for details)</td>
				<td>false</td>
				<td>No</td>
			</tr>
			<tr>
				<td>resolvestylesheetexternals</td>
				<td>Boolean</td>
				<td>Whether to resolve entities in the stylesheet.</td>
				<td>false</td>
				<td>No</td>
			</tr>
		</tbody>
	</table>

	<h3>Nested Tags</h3>
	<p>
		The <em>XsltFilter</em> filter may contain one or more <em>param</em>
		tags to pass any XSLT parameters to the stylesheet. These <em>param</em>
		tags must have <em>name</em> and <em>expression</em> attributes.
	</p>

</body>
</html>
